package cn.wh.mapping;

import cn.wh.session.Configuration;
import cn.wh.type.JdbcType;

/**
 * @Author: wh
 * @CreateTime: 2023-01-17  15:09
 * @Description: 参数映射 #{property,javaType=int,jdbcType=NUMERIC}
 * @Version: 1.0
 */
public class ParameterMapping {


    private Configuration configuration;

    private String property;

    private Class<?> javaType = Object.class;

    private JdbcType jdbcType;

    private ParameterMapping() {

    }

    public static class Builder {

        private ParameterMapping parameterMapping = new ParameterMapping();

        public Builder(Configuration configuration,String property){
            parameterMapping.configuration=configuration;
            parameterMapping.property=property;
        }
        public Builder javaType(Class<?>javaType){
            parameterMapping.javaType=javaType;
            return this;
        }
        public Builder jdbcType(JdbcType jdbcType){
            parameterMapping.jdbcType=jdbcType;
            return this;
        }


    }

    public Configuration getConfiguration() {
        return configuration;
    }

    public String getProperty() {
        return property;
    }

    public Class<?> getJavaType() {
        return javaType;
    }

    public JdbcType getJdbcType() {
        return jdbcType;
    }

}
